home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
C64
/
E-Education
/
(c)ed14.d64
/
lesson 18
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2007-02-04
|
8KB
|
223 lines
10 GOTO100
50 REM <YES>
51 S=54272:FORE=STOS+28:POKEE,0:NEXT
52 POKE54296,15:POKE54277,42:POKE54278,250
53 POKE54276,23:POKE54273,23:POKE54272,191
54 FORT=1TO150:NEXT:POKE54276,32:FORT=1TO200:NEXT
55 POKE54296,0:RETURN
60 REM <N0>
61 S=54272:FORE=STOS+28:POKEE,0:NEXT
62 POKE54296,15:POKE54277,18:POKE54278,242
63 POKE54276,33:POKE54273,4:POKE54272,48
64 FORT=1TO250:NEXT:POKE54276,32:FORT=1TO300:NEXT
65 POKE54296,0:RETURN
70 REM <BLIP>
71 S=54272:FORE=STOS+28:POKEE,0:NEXT
72 POKE54296,5:POKE54277,42:POKE54278,250
73 POKE54276,23:POKE54273,23:POKE54272,191
74 FORT=1TO30:NEXT:POKE54276,32:FORT=1TO50:NEXT
75 POKE54296,0:RETURN
80 FORT=1TO500:NEXT:RETURN
81 FORT=1TO1000:NEXT:RETURN
82 FORT=1TO2000:NEXT:RETURN
83 FORT=1TO3000:NEXT:RETURN
84 FORT=1TO4000:NEXT:RETURN
85 FORT=1TO5000:NEXT:RETURN
90 GOSUB81:GOSUB70
91 PRINT"[154] [208]RESS [211][208][193][195][197][160][194][193][210][160]TO CONTINUE
92 [161]R$:[139]R$[179][177][199](32)[167]92
93 [142]
95 [153]" PEEKETTER LUCK WITH THE NEXT QUESTION.OPEN":[142]
100 [151]53280,0:[151]53281,0:[151]646,3:[151]53272,23:C[178]0:P[178]0:W[178]0:D[178]0:G[178]0
101 [153]"LOAD ATNCLOSE(null)(null)(null)CHR$CLOSEVALSTR$(null)LENATN(null)RIGHT$(null)(null)ATN(null)CLOSE(null)(null)(null)CHR$(null)ATN(null)
102 PRINT" [198][207][210][160][195]64 [195][207][205][208][213][212][197][210][211]
105 [153]" WAIT";
110 [153]" WAIT";
115 [153]" (null)RACTICE (null)ROBLEMS IN ATNRITHMETIC WAIT";
120 [153]" WAIT";
125 [153]" CHR$RADE 4 (null)ART 1 WAIT";
130 [153]" WAIT";
135 [153]" (null)ESSON 18 WAIT";
140 [153]" WAIT";
145 [153]" CHR$ENERAL (null)ROBLEMS OPEN WAIT";
150 [153]" WAIT";
155 [153]" WAIT"
160 [153]" WHC ONON"
165 [141]90
170 [153]"LOAD ATNND AWAY WE GO......."
175 [141]81:[141]50:[141]80
200 [153]"PRINT#LOAD (null)UESTION 1 WAITOPEN":Z[178]0
205 [153]" (null)ARGARET WEIGHED 52KG.
210 PRINT" [200]ER BROTHER, [194]EN,IS 19KG HEAVIER.
215 [153]" LEFT$OW MUCH DOES HE WEIGH? (IN KG) "
220 [141]81:[141]70
225 [153]" ON"
230 [133] A$
240 [139]A$[179][177]"71 KG"[175]A$[179][177]"71KG"[167] 270
250 [153]"SYS LEN(null)(null)(null)VALLEN(null)!! WAITOPEN":[141]50:[141]82
260 P[178]P[170]1:[137]300
270 [153]"DEF (null)(null)LENLEFT$! .......... (null)HAT LEFT$(null)(null)(null)!":[141]60:[141]82:Z[178]Z[170]1
275 [139]Z[178]2[167]G[178]G[170]1:[137]295
280 [153]"ON (null)RY AGAIN ":[141]70:[141]81:W[178]W[170]1
290 [153]"OPENONON ONONONONONONON":[137]225
295 [153]"ONON PEEKEN WEIGHS 71DEFKG. ":[141]82
297 [153]" 52 + 19 = 71 ":[141]82:[141]90
300 [153]"PRINT#LOAD (null)UESTION 2 WAITOPEN":Z[178]0
305 [153]" ATNT THE BEGINNING OF VACATION LEFT$ARRY
310 PRINT" WEIGHED 35 KG. [201]F HE GAINS 7 KG
315 [153]" IN A YEAR, HOW MUCH WILL HE WEIGH THEN? (IN KG) "
320 [141]81:[141]70
325 [153]" ON"
330 [133] A$
340 [139]A$[179][177]"42KG"[175]A$[179][177]"42 KG"[167]370
350 [153]"SYS LEN(null)(null)(null)VALLEN(null)!! WAITOPEN":[141]50:[141]82
360 P[178]P[170]1:[137]400
370 [153]"DEF (null)(null)LENLEFT$! .......... (null)HAT LEFT$(null)(null)(null)!":[141]60:[141]82:Z[178]Z[170]1
375 [139]Z[178]2 [167] G[178]G[170]1:[137]395
380 [153]"ON (null)RY AGAIN ":[141]70:[141]81:W[178]W[170]1
390 [153]"OPENONON ONONONONONONON":[137]325
395 [153]"ONON LEFT$E WILL WEIGH 42DEFKG. ":[141]82
397 [153]" 35 + 7 = 42 ":[141]82:[141]90
400 [153]"PRINT#LOAD (null)UESTION 3 WAITOPEN":Z[178]0
405 [153]" CHR$EORGE BOUGHT 48 MARBLES TO DIVIDE
410 PRINT" EQUALLY WITH HIS THREE BROTHERS.
415 [153]" LEFT$OW MANY MARBLES DID EACH GET?"
420 [141]81:[141]70
425 [153]" ON"
430 [133] A$
440 [139]A$[179][177]"12"[175]A$[179][177]"12 MARBLES"[167] 470
450 [153]"SYS LEN(null)(null)(null)VALLEN(null)!! WAITOPEN":[141]50:[141]82
460 P[178]P[170]1:[137]500
470 [153]"DEF (null)(null)LENLEFT$! .......... (null)HAT LEFT$(null)(null)(null)!":[141]60:[141]82:Z[178]Z[170]1
475 [139]Z[178]2[167]G[178]G[170]1:[137]495
480 [153]"ON (null)RY AGAIN ":[141]70:[141]81:W[178]W[170]1
490 [153]"OPENONON ONONONONONONON":[137]425
495 [153]"ONON VALACH WILL GET 12DEF MARBLES. ":[141]82
497 [153]" 48 / 4 = 12 ":[141]82:[141]90
500 [153]"PRINT#LOAD (null)UESTION 4 WAITOPEN":Z[178]0
505 [153]" LEFT$OW MANY DAYS ARE THERE IN (null)ARCH
510 PRINT" AND [193]PRIL?"
520 GOSUB81:GOSUB70
525 PRINT" [145]"
530 INPUT A$
540 IFA$<>"61"ANDA$<>"61 DAYS"THEN 570
550 PRINT"[158] [195][207][210][210][197][195][212]!! [146][159]":GOSUB50:GOSUB82
560 P=P+1:GOTO600
570 PRINT"[150] [207][213][195][200]! .......... [212]HAT [200][213][210][212]!":GOSUB60:GOSUB82:Z=Z+1
575 IFZ=2THENG=G+1:GOTO595
580 PRINT"[145] [212]RY AGAIN ":GOSUB70:GOSUB81:W=W+1
590 PRINT"[159][145][145] [145][145][145][145][145][145][145]":GOTO525
595 PRINT"[145][145] [212]HERE ARE 61[150] DAYS. ":GOSUB82
597 PRINT" 31 + 30 = 61 ":GOSUB82:GOSUB90
600 PRINT"[152][147] [209]UESTION 5 [146][159]":Z=0
605 PRINT" [212]HE CLASS VOTED FOR A LEADER. [200]ELEN
610 [153]" GOT 17 VOTES AND (null)IMON GOT 24. LEFT$OW MANY PUPILS VOTED?
620 GOSUB81:GOSUB70
625 PRINT" [145]"
630 INPUT A$
640 IFA$<>"41"ANDA$<>"41 PUPILS"THEN 670
650 PRINT"[158] [195][207][210][210][197][195][212]!! [146][159]":GOSUB50:GOSUB82
660 P=P+1:GOTO700
670 PRINT"[150] [207][213][195][200]! .......... [212]HAT [200][213][210][212]!":GOSUB60:GOSUB82:Z=Z+1
675 IFZ=2THENG=G+1:GOTO695
680 PRINT"[145] [212]RY AGAIN ":GOSUB70:GOSUB81:W=W+1
690 PRINT"[159][145][145] [145][145][145][145][145][145][145]":GOTO625
695 PRINT"[145][145] 41[150] PUPILS VOTED. ":GOSUB82
697 PRINT" 17 + 24 = 41 ":GOSUB82:GOSUB90
700 PRINT"[152][147] [209]UESTION 6 [146][159]":Z=0
705 PRINT" [202]OHN, [212]OM, AND [194]OB BOUGHT A BALL FOR
710 [153]" 75 CENTS AND AGREED TO PAY EQUALLY.
715 PRINT" [200]OW MUCH SHOULD EACH PAY? (IN CENTS) "
720 GOSUB81:GOSUB70
725 PRINT" [145]"
730 INPUT A$
740 IFA$<>"25"ANDA$<>"25 CENTS" THEN 770
750 PRINT"[158] [195][207][210][210][197][195][212]!! [146][159]":GOSUB50:GOSUB82
760 P=P+1:GOTO800
770 PRINT"[150] [207][213][195][200]! .......... [212]HAT [200][213][210][212]!":GOSUB60:GOSUB82:Z=Z+1
775 IFZ=2THEN G=G+1:GOTO795
780 PRINT"[145] [212]RY AGAIN ":GOSUB70:GOSUB81:W=W+1
790 PRINT"[159][145][145] [145][145][145][145][145][145][145]":GOTO725
795 PRINT"[145][145] [197]ACH SHOULD PAY 25[150] CENTS. ":GOSUB82
797 PRINT" 75 / 3 = 25 ":GOSUB82:GOSUB90
800 PRINT"[152][147] [209]UESTION 7 [146][159]":Z=0
805 PRINT" [210]OB HAS 56 CENTS AND [198]AN HAS 72
810 [153]" CENTS. LEFT$OW MUCH MORE MONEY HAS
815 PRINT" [198]AN THAN [210]OB? (IN CENTS) "
820 GOSUB81:GOSUB70
825 PRINT" [145]"
830 INPUT A$
840 IFA$<>"16"ANDA$<>"16 CENTS" THEN 870
850 PRINT"[158] [195][207][210][210][197][195][212]!! [146][159]":GOSUB50:GOSUB82
860 P=P+1:GOTO900
870 PRINT"[150] [207][213][195][200]! .......... [212]HAT [200][213][210][212]!":GOSUB60:GOSUB82:Z=Z+1
875 IFZ=2THEN G=G+1:GOTO895
880 PRINT"[145] [212]RY AGAIN ":GOSUB70:GOSUB81:W=W+1
890 PRINT"[159][145][145] [145][145][145][145][145][145][145]":GOTO825
895 PRINT"[145][145] [198]AN HAS 16[150] CENTS MORE. ":GOSUB82
897 PRINT" 72 + 56 = 16 ":GOSUB82:GOSUB90
900 PRINT"[152][147] [209]UESTION 8 [146][159]":Z=0
905 PRINT" [215]HAT SHOULD [201] PAY FOR FIVE APPLES
910 [153]" AT 8 CENTS EACH? (IN CENTS)"
920 [141]81:[141]70
925 [153]" ON"
930 [133] A$
940 [139]A$[179][177]"40"[175]A$[179][177]"40 CENTS" [167] 970
950 [153]"SYS LEN(null)(null)(null)VALLEN(null)!! WAITOPEN":[141]50:[141]82
960 P[178]P[170]1:[137]1000
970 [153]"DEF (null)(null)LENLEFT$! .......... (null)HAT LEFT$(null)(null)(null)!":[141]60:[141]82:Z[178]Z[170]1
975 [139]Z[178]2[167] G[178]G[170]1:[137]995
980 [153]"ON (null)RY AGAIN ":[141]70:[141]81:W[178]W[170]1
990 [153]"OPENONON ONONONONONONON":[137]925
995 [153]"ONON RIGHT$ MUST PAY 40DEF CENTS. ":[141]82
997 [153]" 5 X 8 = 40 ":[141]82:[141]90
1000 [153]"PRINT#LOAD (null)UESTION 9 WAITOPEN":Z[178]0
1005 [153]" ATNT FORTY CENTS FOR 5 APPLES, HOW
1010 PRINT" MUCH IS EACH APPLE? (IN CENTS "
1020 GOSUB81:GOSUB70
1025 PRINT" [145]"
1030 INPUT A$
1040 IFA$<>"8"ANDA$<>"8 CENTS" THEN 1070
1050 PRINT"[158] [195][207][210][210][197][195][212]!! [146][159]":GOSUB50:GOSUB82
1060 P=P+1:GOTO1100
1070 PRINT"[150] [207][213][195][200]! .......... [212]HAT [200][213][210][212]!":GOSUB60:GOSUB82:Z=Z+1
1075 IFZ=2THEN G=G+1:GOTO1095
1080 PRINT"[145] [212]RY AGAIN ":GOSUB70:GOSUB81:W=W+1
1090 PRINT"[159][145][145] [145][145][145][145][145][145][145]":GOTO1025
1095 PRINT"[145][145] [201]T IS 8[150] CENTS PER APPLE. ":GOSUB82
1097 PRINT" 40 / 5 = 8 ":GOSUB82:GOSUB90
1100 PRINT"[152][147] [209]UESTION 10 [146][159]":Z=0
1105 PRINT" [201]F [198]RANK HAD 36 MARBLES AND GAVE 13
1110 [153]" MID$AMIE, HOW MANY MARBLES HAD HE THEN?"
1120 [141]81:[141]70
1125 [153]" ON"
1130 [133] A$
1140 [139]A$[179][177]"23"[175]A$[179][177]"23 MARBLES"[167] 1170
1150 [153]"SYS LEN(null)(null)(null)VALLEN(null)!! WAITOPEN":[141]50:[141]82
1160 [137]1200
1170 [153]"DEF (null)(null)LENLEFT$! .......... (null)HAT LEFT$(null)(null)(null)!":[141]60:[141]82:Z[178]Z[170]1
1175 [139]Z[178]2[167] G[178]G[170]1:[137]1195
1180 [153]"ON (null)RY AGAIN ":[141]70:[141]81:W[178]W[170]1
1190 [153]"OPENONON ONONONONONONON":[137]1125
1195 [153]"ONON ASCRANK HAD 23DEF MARBLES. ":[141]82
1197 [153]" 36 - 13 = 23 ":[141]82:[141]90
1200 [153]"LOAD (null)EPORT LENARD WAIT"
1205 D[178]W[171]G:C[178]10[171]W
1210 [153]"PRINT 1. (null)UESTIONS ANSWERED CORRECTLY ON FIRST TRY:
1215 PRINT" ";C
1220 PRINT"[129] 2. [209]UESTIONS ANSWERED CORRECTLY ON SECOND TRY:
1225 [153]" ";D
1230 [153]"DEF 3. (null)UESTIONS MISSED ON SECOND TRY:
1235 PRINT" ";G;""
1245 GOSUB90
1250 PRINT"[158][147] [217]OU HAVE A CHOICE:
1255 [153]" (null)RESS (null) WAIT TO REPEAT THIS LESSON
1260 PRINT" [208]RESS [205] [146] TO RETURN TO THE MENU[159]"
1265 GETR$:IFR$<>"R"ANDR$<>"M"THEN1265
1270 IFR$="R"THENRESTORE:GOTO100
1280 PRINT"[147] [210]ETURNING TO THE MENU
1285 [147]"MENU",8
1290 [138]
1295 [128]
1300 [143] BILL CUMBERLAND 90:10:28